<?php
// 更改商品信息
// header("content-type:text/html;charset=utf-8");
include_once("conn.php");
//设置默认时区
date_default_timezone_set('PRC');
$now_date = date('Y-m-d H:i:s');

$gid = $_POST['gid'];
$gname = $_POST['goods_name'];
$gprice = $_POST['goods_price'];
$gnum = $_POST['goods_num'];
$gspecs = $_POST['goods_specs'];
$gdescribe = $_POST['goods_describe'];

$sql = "UPDATE tb_goods_info 
        SET g_name = '".$gname."', g_price = '".$gprice."', g_num = '".$gnum."', g_specs = '".$gspecs."', g_describe = '".$gdescribe."'  WHERE g_id = '".$gid."'";
$result = mysqli_query($conn, $sql);
if($result){
    echo "<script>alert('修改成功！');history.go(-1);</script>";
}else{
    echo "<script>alert('修改失败！');history.go(-1);</script>";
}